package dt.inlee.common.dao.api;

import java.util.List;

import dt.inlee.common.exception.FrameworkException;
import dt.inlee.common.pagination.PageBean;
import dt.inlee.common.pagination.SearchBean;

/**
 * 通用service方法接口
 * 
 * @author 陈燕波
 * @version 2014-05-06
 */
public interface ICommonService {

	/**
	 * Add a object
	 * 
	 * @param entity
	 * @return
	 * @throws FrameworkException
	 */
	public int save(Class<?> entity) throws FrameworkException;

	/**
	 * Update a object
	 * 
	 * @param entity
	 * @throws FrameworkException
	 */
	public void update(Class<?> entity) throws FrameworkException;

	/**
	 * Show a object
	 * 
	 * @param id
	 * @return
	 * @throws FrameworkException
	 */
	public Class<?> getEntityById(Integer id) throws FrameworkException;

	/**
	 * Delete an object by id
	 * 
	 * @param id
	 * @throws FrameworkException
	 */
	public void deleteById(int id) throws FrameworkException;

	/**
	 * search list
	 * 
	 * @param sb
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 * @throws FrameworkException
	 */
	public PageBean GetPage(SearchBean sb, int pageIndex, int pageSize)
			throws FrameworkException;

	public List<?> getList(SearchBean sb) throws FrameworkException;

	public PageBean getList(SearchBean sb, int rows, int page)
			throws FrameworkException;
}
